//
//  BarcodeViewController.m
//  News
//
//  Created by 徐涵菲 on 2018/4/23.
//  Copyright © 2018年 Wangly. All rights reserved.
//

#import "BarcodeViewController.h"
#import "MeViewController.h"

@interface BarcodeViewController ()

@property (weak,nonatomic) IBOutlet NSLayoutConstraint *barcodeConsY;
/**
 *  点击我的名片按钮
 */
- (IBAction)me:(UIButton *)sender;

@end

@implementation BarcodeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // 创建一个定时器
    CADisplayLink *link=[CADisplayLink displayLinkWithTarget:self selector:@selector(update)];
    [link addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
        
}

-(void)update
{
    self.barcodeConsY.constant-=5;
    if (self.barcodeConsY.constant<=-124) {
        self.barcodeConsY.constant=124;
    }
}
- (IBAction)me:(UIButton *)sender {
    // 创建名片控制器
    MeViewController *meVc = [[MeViewController alloc] init];
    [self.navigationController pushViewController:meVc animated:YES];
}

@end
